.kaitify-checkbox {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  font-size: @font-size;
  color: @font-color;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 300ms;

  &,
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    outline: none;
  }

  .kaitify-checkbox-el {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 15px;
    height: 15px;
    position: relative;
    border: 1px solid @border-color;
    border-radius: @border-radius;
    user-select: none;
    touch-action: none;
    transition: all 300ms;

    &::before {
      content: '';
      position: absolute;
      left: 4px;
      top: 1px;
      width: 0px;
      height: 0px;
      margin-top: 5px;
      border: solid @theme;
      border-width: 0;
      transform: rotate(45deg);
      border-color: #fff;
      user-select: none;
      touch-action: none;
      transition: width 100ms ease-in-out, height 200ms ease-in-out, margin-top 200ms ease-in-out;
    }

    &.kaitify-checkbox-active {
      background: @theme;
      border-color: @theme;

      &::before {
        margin-top: 0;
        width: 5px;
        height: 10px;
        border-width: 0 2px 2px 0;
      }
    }

    input[type='checkbox'] {
      opacity: 0;
      position: absolute;
      left: 0;
      top: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      margin: 0;
      cursor: pointer;
    }
  }

  .kaitify-checkbox-label {
    margin-left: @small-margin;
  }

  &:not(.kaitify-disabled):hover {
    cursor: pointer;
    opacity: 1;
  }

  &.kaitify-disabled {
    opacity: 0.5;
    cursor: not-allowed;

    .kaitify-checkbox-el > input[type='checkbox'] {
      cursor: not-allowed;
    }
  }

  &.kaitify-dark {
    color: @font-color-dark;

    .kaitify-checkbox-el {
      border-color: @border-color-dark;
    }
  }
}
